/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.opgea.appstreet.domain.entities;

import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Ramesh
 */
@Entity
@Table(name = "productprofile")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ProductProfile.findAll", query = "SELECT p FROM ProductProfile p"),
    @NamedQuery(name = "ProductProfile.findById", query = "SELECT p FROM ProductProfile p WHERE p.id = :id")})
public class ProductProfile implements Serializable {
    
    @Id
    @GeneratedValue
    private Long id;
    @Lob
    private byte[] aboutProduct;
    @Lob
    private byte[] aboutPrice;
    @OneToOne(cascade= CascadeType.ALL)
    private Product product;

    public ProductProfile() {
    }

    public byte[] getAboutPrice() {
        return aboutPrice;
    }

    public void setAboutPrice(byte[] aboutPrice) {
        this.aboutPrice = aboutPrice;
    }

    public byte[] getAboutProduct() {
        return aboutProduct;
    }

    public void setAboutProduct(byte[] aboutProduct) {
        this.aboutProduct = aboutProduct;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ProductProfile other = (ProductProfile) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 73 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "ProductProfile{" + "id=" + id + ", aboutProduct=" + aboutProduct + ", aboutPrice=" + aboutPrice + ", product=" + product + '}';
    }
    
    
}
